<template>
  <div id="app">
    <Header/>

    <router-view/>
    <!-- 在Home、Search显示的, 在登录注册隐藏  -->
    <Footer v-show="isFooterShow"/>
  </div>
</template>

<script>

import Header from "components/Header";
import Footer from "components/Footer";


export default {
  name: 'app',
  components: {
    Header,
    Footer
  },
  created() {
    //1.派发actions
    this.$store.dispatch('categoryList');
  },
  computed: {
    // Footer组件的显示与隐藏
    isFooterShow() {
      //通过 路由元信息判断
      return this.$route.meta.show
      //通过 $route.path 判断
      // return  this.$route.path === '/home' || this.$route.path === '/search'
    },
  }
}
</script>

<style scoped>
</style>